Conversation
| enum MovieCategory: String { | ||
| case popular | ||
| case nowPlaying = "now_playing" | ||
| case topRated = "top_rated" | ||
| case upcoming | ||
| } |
There was a problem hiding this comment.
이건 model이나 data 쪽으로 옮겨도 좋을 것 같아요 ~!
request 폴더를 만들어도 좋을 것 같습니다 ~!
| protocol MovieRepositoryProtocol { | ||
| func fetchNowPlayingMovies() async throws -> [Movie] | ||
| func fetchUpcomingMovies() async throws -> [Movie] | ||
| func fetchPopularMovies() async throws -> [Movie] | ||
| } | ||
|
|
||
| private enum MovieRepositoryKey: DependencyKey { | ||
| static let liveValue: any MovieRepositoryProtocol = MovieRepository() | ||
| static let previewValue: any MovieRepositoryProtocol = MockMovieRepository() | ||
| static let testValue: any MovieRepositoryProtocol = MockMovieRepository() | ||
| } | ||
|
|
||
| extension DependencyValues { | ||
| var movieRepository: MovieRepositoryProtocol { | ||
| get { self[MovieRepositoryKey.self] } | ||
| set { self[MovieRepositoryKey.self] = newValue } | ||
| } | ||
| } |
There was a problem hiding this comment.
오 좋은데요 ? repository도 해보고싶었는데 단일 레포라 가능하겠네요
| let movieTitle: String | ||
| let movieRating: Int | ||
| let posterPath: String? |
There was a problem hiding this comment.
접근 제어를 해주는 것도 좋을 것 같습니다 ~!
| struct StarRatingView: View { | ||
| let rating: Int | ||
|
|
||
| var body: some View { | ||
| HStack(spacing: 4) { | ||
| ForEach(1...5, id: \.self) { index in | ||
| Image(systemName: "star.fill") | ||
| .resizable() | ||
| .scaledToFit() | ||
| .frame(width: 12, height: 12) | ||
| .foregroundColor(index <= rating ? .yellow : .gray) | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
이거 progressView인가 그거로 하면 3.8의 별점도 표현할 수 있을 것 같은데 이건 시간 더 있으면 개선사항으로 해보시죠!
There was a problem hiding this comment.
저도 동일한 뷰를 사용해야해서 우선 사용하다가 시간 있으면 개선하겠습니다 !
|
|
||
| @Reducer | ||
| struct MovieListFeature { | ||
| @Dependency(\.movieRepository) var movieRepository |
There was a problem hiding this comment.
아 repository를 바로 feature에 들어갔군요
음 .. 생각해볼내용이네요
repository 인터페이스는 어쨋든 domain에 있으니 참조할 수 있지 않나? 라는 생각이 들면서도
구현체는 data 레이어에 있어서 괜찮은건가? 라는 생각도 드네요
이건 저도 좀더 찾아보겠습니다.
|
|
||
| enum Action { | ||
| case onAppear | ||
| case fetchMovie |
There was a problem hiding this comment.
@minneee 여기 Action 들을 조금 나누어 보는건 어떨까요 ?? 지금도 좋은데 뷰액션을 나누어 보는것도 괜찮을거 같습니다 !
✨ 작업 내용
Checklist